Skip to content

fix(buffa-codegen): add unused_qualifications to ALLOW_LINTS#102

Merged
iainmcgin merged 2 commits intomainfrom
iain/codegen-allow-unused-qualifications
May 7, 2026
Merged

fix(buffa-codegen): add unused_qualifications to ALLOW_LINTS#102
iainmcgin merged 2 commits intomainfrom
iain/codegen-allow-unused-qualifications

Conversation

@iainmcgin
Copy link
Copy Markdown
Collaborator

Adds unused_qualifications to the ALLOW_LINTS block emitted on the per-package .mod.rs stitcher.

Why

buffa-codegen emits cross-proto references through the canonical super::super::__buffa::view::… (and …::oneof::…) path even when the target lives in the same generated module — the per-proto split places sibling protos' __view.rs files into one pub mod __buffa::view, so ChainView referencing SignedLinkView could just be SignedLinkView. The codegen still uses the canonical path because it is stable when a sibling proto defines a same-named natural-path re-export that would shadow the bare name.

unused_qualifications flags this as a redundant qualification. Workspaces that opt the lint to warn and build with -D warnings get false positives on every cross-proto reference. The qualification is intentional, so the right fix is to suppress the lint at the package-stitcher boundary — the same scope where we already suppress dead_code, unused_imports, and friends.

Verification

  • cargo test -p buffa-codegen --lib: 327 passed
  • cargo test -p buffa-test --lib: 292 passed
  • cargo clippy -p buffa-test -p buffa-codegen --lib -- -D warnings: clean

The new entry only affects the #[allow(...)] block on the generated pub mod __buffa { … }; no runtime behaviour changes.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@iainmcgin iainmcgin force-pushed the iain/codegen-allow-unused-qualifications branch 2 times, most recently from f4e30f4 to 20713e9 Compare May 7, 2026 15:40
@iainmcgin iainmcgin marked this pull request as ready for review May 7, 2026 15:43
@iainmcgin iainmcgin requested a review from rpb-ant May 7, 2026 15:43
Cross-proto references within the same package are emitted through the
canonical `super::super::__buffa::view::…` (and `…::oneof::…`) path even
though the target lives in the same generated module. The bare name would
resolve, but the canonical path is stable when a sibling proto defines a
same-named natural-path re-export. Workspaces that enable
`unused_qualifications = "warn"` and build with `-D warnings` were getting
false positives from generated code; the lint is now in the package
stitcher's `#[allow(...)]` block alongside `dead_code`, `unused_imports`,
etc.
@iainmcgin iainmcgin force-pushed the iain/codegen-allow-unused-qualifications branch from 20713e9 to 9e0358b Compare May 7, 2026 15:54
@iainmcgin iainmcgin enabled auto-merge (squash) May 7, 2026 15:56
@iainmcgin iainmcgin merged commit 843afd6 into main May 7, 2026
7 checks passed
@iainmcgin iainmcgin deleted the iain/codegen-allow-unused-qualifications branch May 7, 2026 16:22
@github-actions github-actions Bot locked and limited conversation to collaborators May 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants